package com.houger.ddd.seckill.constant;

import lombok.Getter;


public enum TemplateStatusEnum {
    INIT(1, "未启用"),
    READY(2, "未开始"),
    ON_GOING(3, "进行中"),
    OVER(4, "已结束"),
    PAUSED(5, "已停用"),
    WAIT_AUDIT(6, "待审核"),
    AUDIT_REFUSE(7, "审核驳回"),
    HAVE_CANCELED(8, "已取消"),
    END(9, "已终止"),
    UN_KNOW(0, "未知");

    @Getter
    private int value;
    @Getter
    private String msg;

    TemplateStatusEnum(Integer value, String msg) {
        this.value = value;
        this.msg = msg;
    }

    public static TemplateStatusEnum findByValue(Integer value) {
        for (TemplateStatusEnum item : values()) {
            if (item.getValue() == (value))
                return item;
        }
        return UN_KNOW;
    }

}
